<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id='app'>
    <!-- 形成了 双向联动 你变我也变 -->
    账户: <input type="text" v-model="username"><br><br>
    密码: <input type="password" v-model="password"><br><br>
    <button>登录</button>
    <button @click="del()">重置</button>
  </div>
  <script src="../vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        username: '',
        password: ''
      },
      methods: {
        del() {
          this.password = '',
            this.username = ''
        }
      }
    })
  </script>
</body>

</html>